﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System;

namespace SacNetUG.Models
{
    public partial class Contact
    {
        public int Id { get; set; }

        [RegularExpression(@"^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$", ErrorMessage = "Email Address is invalid")]
        [Required(ErrorMessage = "Email address is required")]
        [DisplayName("Email Address")]
        public string Email { get; set; }

        public string Name { get; set; }

        public string Address { get; set; }

        public string City { get; set; }

        public string State { get; set; }

        public int? Zip { get; set; }

        public string Country { get; set; }

        [DisplayName("Phone #")]
        public string PhoneNumber { get; set; }

        [Required(ErrorMessage = "Message is required")]
        [DisplayName("Comments")]
        public string Comments { get; set; }

        public override string ToString()
        {
            const string frmt = "Email:{0}\r\nName:{1}\r\nAddress:{2}\r\nCity:{3}\r\nState:{4}\r\nZip:{5}\r\nCounty:{6}\r\nPhone:{7}\r\nComments:{8}\r\n";
            return string.Format(frmt, Email, Name, Address, City, State, Zip, Country, PhoneNumber, Comments);
        }
    }
}